package com.jf.test.mvvm

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.LifecycleOwner
import com.jf.test.R
import com.jf.test.databinding.FragmentMainBinding
import com.jf.test.mvvm.base.BaseDBFragment

/**
 * @Class: MainFragment
 * @Description:
 * @author: github.com/jackyflame
 * @Date: 2021/3/10
 */
class MainFragment : BaseDBFragment<FragmentMainBinding, MainFragVM>() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        bindLayout(inflater,getLayoutId(),container, MainFragVM::class.java)
        binding?.txvTitle?.text = "Hello world!FK KOTLIN MVVM";
        return binding?.root;
    }

    override fun getLayoutId(): Int {
        return R.layout.fragment_main;
    }

    fun testFromFragment(){
        viewModel?.testSend();
    }

}